const express = require("express");
const menuRouter = express.Router();
const DB = require("./../db/config");

const myjwt = require("jsonwebtoken");
module.exports = menuRouter;


menuRouter.route("/menu/list")
.get((req, res)=>{
  res.json({
    code: 0,
    msg: '请求成功',
    data:  [
      {
          menuId: 2,
          menuName: "用户管理",
          menuUrl: "/home/user",
          pathname: "userlist",
          componentPath: "UserManger",
          menuImgClass: 'TeamOutlined',
          pId:0,
          menuState: "0",
          isContainChildren:false,
          menuChilds: [{
              menuId: 10,
              menuName: "添加用户",
              menuUrl: "/home/adduser",
              pathname: "adduser",
			  // nav:['首页','用户管理','添加用户'],
              componentPath: "AddUser",
              menuImgClass: 'VideoCameraAddOutlined',
              pId:2,
              menuState: "0",
              isContainChildren:false,
              menuChilds: []
          },{
              menuId: 11,
              menuName: "修改用户",
              menuUrl: "/home/modifyUser",
              pathname: "modifyUser",
              componentPath: "ModifyUser",
              menuImgClass: 'VideoCameraAddOutlined',
              pId:2,
              menuState: "0",
              isContainChildren:false,
              menuChilds: []
          }]
      },
      {
          menuId: 3,
          menuName: "角色管理",
          menuUrl: "/home/role",
          pathname: "role",
          componentPath: "RoleManger",
          menuImgClass: 'WhatsAppOutlined',
          pId:0,
          menuState: "0",
          isContainChildren:true,
          menuChilds: [
              {
                  menuId: 7,
                  menuName: "添加角色",
                  menuUrl: "/home/addrole",
                  pathname: "addrole",
                  componentPath: "AddRole",
                  menuImgClass: 'VideoCameraAddOutlined',
                  pId:3,
                  menuState: "0",
                  isContainChildren:false,
                  menuChilds: []
              },
              {
                  menuId: 8,
                  menuName: "角色详情",
                  menuUrl: "/home/roleInfo",
                  pathname: "roleInfo",
                  componentPath: "RoleInfo",
                  menuImgClass: 'TagOutlined',
                  isContainChildren:false,
                  pId:3,
                  menuState: "0",
                  menuChilds: []
              },
              {
                  menuId: 9,
                  menuName: "角色列表",
                  menuUrl: "/home/rolelist",
                  pathname: "rolelist",
                  componentPath: "RoleList",
                  menuImgClass: 'StarOutlined',
                  pId:3,
                  menuState: "0",
                  isContainChildren:false,
                  menuChilds: []
              }
          ]
      },
      {
        menuId: 10,
        menuName: "产品管理",
        menuUrl: "/home/product",
        pathname: "product",
        componentPath: "ProductView",
        menuImgClass: 'WhatsAppOutlined',
        pId:0,
        menuState: "0",
        isContainChildren:true,  
        menuChilds: []
      },
      {
        menuId: 11,
        menuName: "客户管理",
        menuUrl: "/home/cusmer",
        pathname: "cusmer",
        componentPath: "CusmerView",
        menuImgClass: 'WhatsAppOutlined',
        pId:0,
        menuState: "0",
        isContainChildren:true, 
         menuChilds: []
      }
  ]
  })
})